package com.cancer.attend.entity;

import java.io.Serializable;
import java.sql.Date;

/**
 * Created by cuiwx on 2016/12/21.
 */
public class AttendReport implements Serializable {
    //考勤类型：0=正常，1=迟到+早退（至少有一个考勤记录），2=迟到（包括无签到），3=早退（包括无签退），4=无考勤记录
    public static final int TYPE_NORMAL = 0;        //正常
    public static final int TYPE_LATE_EARLY = 1;    //迟到+早退（至少有一个考勤记录）
    public static final int TYPE_LATE = 2;          //迟到（包括无签到）
    public static final int TYPE_EARLY = 3;         //早退（包括无签退）
    public static final int TYPE_ABSENT = 4;        //无考勤记录
    public static final int TYPE_ACCOMMODATION = 5; //出差
    public static final int TYPE_VACATION = 6;      //请假
    public static final int TYPE_REST = 7;          //休息
    public static final int TYPE_WHITE = 8;         //白名单

    public static final String DESC_NORMAL = "正常";
    public static final String DESC_LATE_EARLY = "迟到｜早退";
    public static final String DESC_LATE = "迟到";
    public static final String DESC_EARLY = "早退";
    public static final String DESC_ABSENT = "无考勤记录";
    public static final String DESC_ACCOMMODATION = "出差";
    public static final String DESC_VACATION = "请假";
    public static final String DESC_WHITE = "－"; //白名单
    public static final String DESC_REST = "休息";

    private Long id; // 自增主键
    private String entCode; //企业CODE
    private String employeeCode; //人员CODE
    private Date day; //考勤统计日期
    private String startWorkTime; //上班时间，来自v30_md_organization表，如 08:00
    private String endWorkTime; //下班时间，来自v30_md_organization表，如 18:00
    private String workDays; //工作日设置，1,2,3,4,5,6,7代表周一到周日
    private Long signInTime; //签到时间，时间戳
    private Long signOutTime; //签退时间，时间戳
    private String signInLatitude; //签到纬度
    private String signInLongitude; //签到经度
    private String signInPlace; //考勤签到地址
    private String signOutLatitude; //签退纬度
    private String signOutLongitude; //签退经度
    private String signOutPlace; //考勤签退地址
    private Long clockingRecordId; //对应v30_bd_clocking_in表的id
    private Integer attendType; //考勤类型：0=正常，1=迟到+早退（至少有一个考勤记录），2=迟到（包括无签到），3=早退（包括无签退），4=无考勤记录
    private Integer extraType; //﻿其他类型信息，1=休息日，2=白名单，null表示无特别标记

    /**
     * 更新考勤类型获取类型描述
     * 考勤类型：0=正常，1=迟到+早退（至少有一个考勤记录），2=迟到（包括无签到），3=早退（包括无签退），4=无考勤记录
     * @param attendType 类型
     * @return
     */
    public static String queryAttendDescByAttendType(int attendType) {
        String attendDesc = DESC_NORMAL;
        switch(attendType) {
            case TYPE_NORMAL:
                attendDesc = DESC_NORMAL;
                break;
            case TYPE_LATE_EARLY:
                attendDesc = DESC_LATE_EARLY;
                break;
            case TYPE_LATE:
                attendDesc = DESC_LATE;
                break;
            case TYPE_EARLY:
                attendDesc = DESC_EARLY;
                break;
            case TYPE_ABSENT:
                attendDesc = DESC_ABSENT;
                break;
            case TYPE_ACCOMMODATION:
                attendDesc = DESC_ACCOMMODATION;
                break;
            case TYPE_VACATION:
                attendDesc = DESC_VACATION;
                break;
            case TYPE_WHITE:
                attendDesc = DESC_WHITE;
                break;
            case TYPE_REST:
                attendDesc = DESC_REST;
                break;
        }
        return attendDesc;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getEntCode() {
        return entCode;
    }

    public void setEntCode(String entCode) {
        this.entCode = entCode;
    }

    public String getEmployeeCode() {
        return employeeCode;
    }

    public void setEmployeeCode(String employeeCode) {
        this.employeeCode = employeeCode;
    }

    public Date getDay() {
        return day;
    }

    public void setDay(Date day) {
        this.day = day;
    }

    public String getStartWorkTime() {
        return startWorkTime;
    }

    public void setStartWorkTime(String startWorkTime) {
        this.startWorkTime = startWorkTime;
    }

    public String getEndWorkTime() {
        return endWorkTime;
    }

    public void setEndWorkTime(String endWorkTime) {
        this.endWorkTime = endWorkTime;
    }

    public String getWorkDays() {
        return workDays;
    }

    public void setWorkDays(String workDays) {
        this.workDays = workDays;
    }

    public Long getSignInTime() {
        return signInTime;
    }

    public void setSignInTime(Long signInTime) {
        this.signInTime = signInTime;
    }

    public Long getSignOutTime() {
        return signOutTime;
    }

    public void setSignOutTime(Long signOutTime) {
        this.signOutTime = signOutTime;
    }

    public String getSignInLatitude() {
        return signInLatitude;
    }

    public void setSignInLatitude(String signInLatitude) {
        this.signInLatitude = signInLatitude;
    }

    public String getSignInLongitude() {
        return signInLongitude;
    }

    public void setSignInLongitude(String signInLongitude) {
        this.signInLongitude = signInLongitude;
    }

    public String getSignInPlace() {
        return signInPlace;
    }

    public void setSignInPlace(String signInPlace) {
        this.signInPlace = signInPlace;
    }

    public String getSignOutLatitude() {
        return signOutLatitude;
    }

    public void setSignOutLatitude(String signOutLatitude) {
        this.signOutLatitude = signOutLatitude;
    }

    public String getSignOutLongitude() {
        return signOutLongitude;
    }

    public void setSignOutLongitude(String signOutLongitude) {
        this.signOutLongitude = signOutLongitude;
    }

    public String getSignOutPlace() {
        return signOutPlace;
    }

    public void setSignOutPlace(String signOutPlace) {
        this.signOutPlace = signOutPlace;
    }

    public Long getClockingRecordId() {
        return clockingRecordId;
    }

    public void setClockingRecordId(Long clockingRecordId) {
        this.clockingRecordId = clockingRecordId;
    }

    public Integer getAttendType() {
        return attendType;
    }

    public void setAttendType(Integer attendType) {
        this.attendType = attendType;
    }

    public Integer getExtraType() {
        return extraType;
    }

    public void setExtraType(Integer extraType) {
        this.extraType = extraType;
    }

}
